package com.hzhc.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzhc.entity.YwOrderShip;
import com.hzhc.mapper.YwOrderShipMapper;
import com.hzhc.service.YwOrderShipService;
import com.hzhc.utils.ResultUtil;
import com.hzhc.vo.YwOrderShipVo;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 散改集船舶信息 服务实现类
 * </p>
 *
 * @author 功不唐捐
 * @since 2024-08-01
 */
@Service
public class YwOrderShipServiceImpl extends ServiceImpl<YwOrderShipMapper, YwOrderShip> implements YwOrderShipService {

    @Override
    public List<YwOrderShipVo> getOrdershipPage(Page<YwOrderShipVo> page, YwOrderShipVo vo) {
        Page<YwOrderShipVo> voPage=baseMapper.getDataList(page,vo);
        return voPage.getRecords();

    }

    @Override
    public ResultUtil<T> updataOrdership(YwOrderShip vo) {
        vo.setIsBack(vo.getIsBack());
        vo.setNoBack(vo.getNoBack());
        vo.setRemark(vo.getRemark());
        boolean b =updateById(vo);
        return b?ResultUtil.ok():ResultUtil.fail();
    }

    @Override
    public List<YwOrderShipVo> getOrdership(YwOrderShipVo vo) {
        List<YwOrderShipVo> list=baseMapper.getDataList(vo);
        return list;
    }
}
